export const transformList = (type, list = []) => {
  const typeMap = {
    inn: {
      id: 'inn_id',
      name: 'inn_name',
    },
    courier: {
      id: 'kdy_id',
      name: 'courier_name',
    },
  };

  const newArr = [
    {
      id: 'all',
      name: '全部',
    },
  ];

  list.forEach(val => {
    val.id = val[typeMap[type].id];
    val.name = val[typeMap[type].name];

    newArr.push({
      id: val[typeMap[type].id],
      name: val[typeMap[type].name],
    });
  });
  return newArr;
};
